Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

output-rotation, mouse-selection, gyro-sensor support, kmscon.conf manpage #75

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

MacSlow
Copy link

@MacSlow MacSlow commented Jul 24, 2023

This is the whole bunch of all the features I added to kmscon (now based on aetf's 'develop' branch). It is output-rotation support, mouse selection/cut/paste support, gyro-sensor support and finally an additional man-page, which documents the configuration-file 'kmscon.conf'.

Each feature/patch also exists as a single branch (building on top of each other), if you prefer smaller chunks. I am trying to make this as easy for review and testing as possible.

@MacSlow MacSlow mentioned this pull request Jul 24, 2023
@takase1121
Copy link

Hi, I've been trying to use this patch in conjunction with #71, it seems that kmscon_mouse.c requires linking to libm (fmod), which isn't done in meson.build and src/meson.build. I kept on getting linking errors without doing that.

@MacSlow
Copy link
Author

MacSlow commented Oct 7, 2023 via email

@MacSlow
Copy link
Author

MacSlow commented Oct 26, 2023

Hi, I've been trying to use this patch in conjunction with #71, it seems that kmscon_mouse.c requires linking to libm (fmod), which isn't done in meson.build and src/meson.build. I kept on getting linking errors without doing that.

I looked at this again on a different machine and cannot reproduce the linking issue with regards to libm. I locally merged skyvine's desired-width/height branch with my PR and do not get any linking issues. I used an Ubuntu 22.04.3 LTS machine with the usual build-essential packages.

Do you perhaps still have a log-file of the failing compile/linking step?

@obrmao
Copy link

obrmao commented Oct 29, 2023

@MacSlow Since I seem to have similar issues let me paste my output:

==> Starting build()...
+ exec meson setup --prefix /usr --libexecdir lib --sbindir bin --buildtype plain --auto-features enabled --wrap-mode nodownload -D b_lto=false -D b_pie=true -D python.bytecompile=1 /home/alarm/kmscon-g/src/kmscon builddir/ -Dtests=false
Directory already configured.

Just run your build command (e.g. ninja) and Meson will regenerate as necessary.
If ninja fails, run "ninja reconfigure" or "meson setup --reconfigure"
to force Meson to regenerate.

If build failures persist, run "meson setup --wipe" to rebuild from scratch
using the same options as passed when configuring the build.
To change option values, run "meson configure" instead.
INFO: autodetecting backend as ninja
INFO: calculating backend command to run: /usr/bin/ninja -C /home/alarm/kmscon-g/src/builddir
ninja: Entering directory `/home/alarm/kmscon-g/src/builddir'
[1/9] Generating src/shl_githead.c with a custom command
fatal: No names found, cannot describe anything.
[2/2] Linking target src/kmscon
FAILED: src/kmscon
cc  -o src/kmscon src/kmscon.p/pty.c.o src/kmscon.p/font.c.o src/kmscon.p/font_8x16.c.o src/kmscon.p/text.c.o src/kmscon.p/text_bblit.c.o src/kmscon.p/kmscon_module.c.o src/kmscon.p/kmscon_seat.c.o src/kmscon.p/kmscon_conf.c.o src/kmscon.p/kmscon_main.c.o src/kmscon.p/kmscon_mouse.c.o src/kmscon.p/kmscon_dummy.c.o src/kmscon.p/kmscon_terminal.c.o -Wl,--as-needed -Wl,--no-undefined -Wl,-export-dynamic -pie -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -march=armv8-a -O2 -pipe -fstack-protector-strong -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -Wl,--start-group src/libconf.a src/libshl.a external/libext-htable.a src/libeloop.a src/libuterm.a /usr/lib/libxkbcommon.so /usr/lib/libtsm.so -pthread /usr/lib/libdbus-1.so /usr/lib/libGLESv2.so /usr/lib/libudev.so /usr/lib/libsystemd.so /usr/lib/libdrm.so /usr/lib/libEGL.so /usr/lib/libgbm.so -Wl,--end-group
/usr/bin/ld: src/kmscon.p/kmscon_mouse.c.o: undefined reference to symbol 'fmodf@@GLIBC_2.17'
/usr/bin/ld: /usr/lib/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
==> ERROR: A failure occurred in build().
    Aborting...

@obrmao
Copy link

obrmao commented Oct 29, 2023

What worked for me is to add:

link_args: ['-lm'],

in src/meson.build as such:

kmscon = executable('kmscon', kmscon_srcs,
  dependencies: [xkbcommon_deps, libtsm_deps, threads_deps, dbus_deps, dl_deps, conf_deps, shl_deps, eloop_deps, uterm_deps],
  export_dynamic: true,
  install: true,
  link_args: ['-lm'],
  install_dir: libexecdir,
)

@takase1121
Copy link

What worked for me is to add:

link_args: ['-lm'],

in src/meson.build as such:

kmscon = executable('kmscon', kmscon_srcs,
  dependencies: [xkbcommon_deps, libtsm_deps, threads_deps, dbus_deps, dl_deps, conf_deps, shl_deps, eloop_deps, uterm_deps],
  export_dynamic: true,
  install: true,
  link_args: ['-lm'],
  install_dir: libexecdir,
)

This is not the correct way to fix it, the correct way is to use compiler.find_library('m') and add it as a dependency.

@obrmao
Copy link

obrmao commented Oct 29, 2023

Thanks @takase1121!

That worked as well, at top:

cc = meson.get_compiler('c')
mlib = cc.find_library('m')

and then:

kmscon = executable('kmscon', kmscon_srcs,
  dependencies: [mlib, xkbcommon_deps, libtsm_deps, threads_deps, dbus_deps, dl_deps, conf_deps, shl_deps, eloop_deps, uterm_deps],
  export_dynamic: true,
  install: true,
  install_dir: libexecdir,
)

…licitly add it (like mine). Thanks to users 'takase1121' and 'obrmao' on github.com for the heads-up.
@MacSlow
Copy link
Author

MacSlow commented Jan 6, 2024

Greetings takase1121 & obrmao!

I added your suggestions to my branches hoping it will avoid other people running into the same issue. Still, I could not reproduce the stated problem on my systems (ubuntu 22.04 and debian 12). But adding that explicit library-dependency does not hurt :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants